import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import locale from "element-plus/lib/locale/lang/zh-cn";
import 'element-plus/theme-chalk/index.css';
// import vuescroll from 'vuescroll'
import router from './router'
import { createPinia } from "pinia";
import './assets/css/reset.scss'// 重置HTML样式
import './assets/css/app.scss' // 全局样式
import './assets/css/el-ui.scss' // 优化element样式
import './assets/css/dark.scss'  // 导入暗黑主题
import components from './components/index'  //注册全局组件
// 统一导入el-icon图标
import * as ElIconModules from '@element-plus/icons'
const app = createApp(App)
// 统一注册el-icon图标
for (let iconName in ElIconModules) {
  app.component(iconName, ElIconModules[`${iconName}` as keyof typeof ElIconModules])
}
// app.use(vuescroll)
app.use(ElementPlus, { locale })
app.use(components)
app.use(router)
app.use(createPinia())
app.mount('#app')